rotating cubes-how it works